package com.data.configuration;

import com.data.interceptor.StudentInterceptor;
import com.data.interceptor.StudentInterceptor2;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @author: wangmq
 * @create: 2024-01-08 11:36
 **/
@Configuration
public class SpringMvcSupport extends WebMvcConfigurationSupport {
    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        //注解拦截器和拦截地址   表示添加 StudentInterceptor  取拦截路径是 /student/* 所有请求
        registry.addInterceptor(new StudentInterceptor()).addPathPatterns("/student/*");
        registry.addInterceptor(new StudentInterceptor2()).addPathPatterns("/student/*");
    }
}
